package com.gexiaobao.pigeon.app.network;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * @Author : hxw
 * @Date : 2023/2/11 14:31
 * @Describe :
 */
public class JsonOrXmlConverterFactory extends Converter.Factory {
    private final Converter.Factory jsonFactory = GsonConverterFactory.create();

    public static JsonOrXmlConverterFactory create() {
        return new JsonOrXmlConverterFactory();
    }

    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
        return jsonFactory.responseBodyConverter(type, annotations, retrofit);
    }

}
